<template>
    <!--只读审批12步-->
    <div style="position: relative;width: 100%;height: 100%">
        <Steps :current="currentTab" id="TitleReadOnly">
            <Step title="家庭信息" content="" @click.native="clickStep(0)"></Step>
            <Step title="家庭成员" content="" @click.native="clickStep(1)"></Step>
            <Step title="基础收入" content="" @click.native="clickStep(2)"></Step>
            <Step title="基础支出" content="" @click.native="clickStep(3)"></Step>
            <Step title="赡抚扶养" content="" @click.native="clickStep(4)"></Step>
            <Step title="基础财产" content="" @click.native="clickStep(5)"></Step>
            <Step title="财产房产" content="" @click.native="clickStep(6)"></Step>
            <Step title="工作单位" content="" @click.native="clickStep(7)"></Step>
            <Step title="教育情况" content="" @click.native="clickStep(8)"></Step>
            <Step title="家庭附件" content="" @click.native="clickStep(9)"></Step>
        </Steps>
        <div id="ContentReadOnly">
            <step1 v-if="currentTab === 0" ref="step1" @nextStep="nextStep"/>
            <step2 v-if="currentTab === 1" @prevStep="prevStep" @nextStep="nextStep"/>
            <step3 v-if="currentTab === 2" @prevStep="prevStep" @nextStep="nextStep"/>
            <step4 v-if="currentTab === 3" @prevStep="prevStep" @nextStep="nextStep"/>
            <step5 v-if="currentTab === 4" @prevStep="prevStep" @nextStep="nextStep"/>
            <step6 v-if="currentTab === 5" @prevStep="prevStep" @nextStep="nextStep"/>
            <step7 v-if="currentTab === 6" @prevStep="prevStep" @nextStep="nextStep"/>
            <step8 v-if="currentTab === 7" @prevStep="prevStep" @nextStep="nextStep"/>
            <step9 v-if="currentTab === 8" @prevStep="prevStep" @nextStep="nextStep"/>
            <step10 v-if="currentTab === 9" ref="step10" @prevStep="prevStep"  />
        </div>
    </div>
</template>

<script>
    import step1 from './application1'
    import step2 from '../ss11_create_steps/application2'
    import step3 from '../ss11_create_steps/application3'
    import step4 from '../ss11_create_steps/application4'
    import step5 from '../ss11_create_steps/application5'
    import step6 from '../ss11_create_steps/application6'
    import step7 from '../ss11_create_steps/application7'
    import step8 from '../ss11_create_steps/application8'
    import step9 from '../ss11_create_steps/application9'
    import step10 from './/application10'
    import '@/views/common/css/common.css';

    export default {
        name: "index",
        components: {
            step1,
            step2,
            step3,
            step4,
            step5,
            step6,
            step7,
            step8,
            step9,
            step10,
        },
        data() {
            return {
                key: "",
                validateCode: true, //第十步附件 验证code： true(验证通过)  false(验证失败)
                validateMsg: '',//第十步附件验证失败提示信息
                currentTab: 999,
                familyInfo: {},
                operationType: '',//操作类型 1:情况变更 2：停救 3：区内迁移 4：跨区迁移
                ssca0016:"",
                ssca0002:"",
                applicationType:""
            }
        },
        methods: {
            edit(record) {
                this.familyInfo = Object.assign({}, record);
                this.familyInfo.oldSs12001Id = this.familyInfo.ss12001Id;
                if(record == undefined) {
                } else {
                    this.familyInfo.ssca0002 = record.ssca0002;
                    this.applicationType = record.ssca0002;
                    this.ssca0016 = record.ssca0016;
                    this.ssca0002 = record.ssca0002;
                }
                this.currentTab = 0;
            },
            clickStep(currentTab) {
                if (currentTab < this.currentTab) {
                    this.currentTab = currentTab
                }
            },
            nextStep() {
                if (this.currentTab == 0) {
                    this.familyInfo = arguments[0]
                }
                this.currentTab += 1
            },
            prevStep() {
                this.currentTab -= 1
            },
            finish() {
                this.$emit('finish');
            }
        },

    }
</script>

<style scoped>
    #ContentReadOnly {
        position: relative;
        width: 100%;
        /*overflow: auto;*/
        margin-top: 40px;
        min-height: 400px;
        height: calc(100% - 100px);
    }

    #TitleReadOnly {
        position: relative;
        width: 100%;
        height: 50px;
        border-bottom: 1px solid #ddd;
        top: 20px;
    }

    /deep/ .ivu-steps-item {
        cursor: pointer;
    }

</style>
